{include common/head}
<div class="container-scroller">
    {include common/header}
    <!-- partial -->
    <div class="container-fluid page-body-wrapper">
        {include common/sidebar}
      <!-- partial -->
      <div class="main-panel">
        <div class="content-wrapper">
          <div class="row">
            <div class="col-lg-12 grid-margin">
              <div class="card">
                <div class="card-body">
                  <h4 class="card-title">已授权网站</h4>
                  <form action="{#WWW}admin/shouquan_list.html">
                    <input type="text" name="domain" class="form-control" value="" placeholder="搜索域名">
                  </form>
                  <form action="{#WWW}admin/shouquan_list.html">
                    <input type="text" name="qq" class="form-control" value="" placeholder="搜索QQ">
                  </form>
                  <div class="table-responsive">
                    <table class="table table-bordered">
                      <thead>
                        <tr>
                          <th>
                            #
                          </th>
                          <th>
                            网站
                          </th>
                          <th>
                            项目
                          </th>
                          <th style="width:100px;">
                            QQ
                          </th>
                          <th style="width:60px;">
                            时间
                          </th>
                          <th style="width:60px;" class="text-center">
                            状态
                          </th>
                          <th>
                            操作
                          </th>
                        </tr>
                      </thead>
                      <tbody>
                        {foreach $data as $v}
                        <tr>
                          <td class="font-weight-medium">
                            {$v.id}
                          </td>
                          <td class="text-primary">
                            <a target="_blank" href="http://{$v.domain}">{$v.domain}</a>
                          </td>
                          <td>
                          {$v.xiangmu}
                          </td>
                          <td>
                            <a target="_blank" class="text-info" href="http://wpa.qq.com/msgrd?v=3&amp;uin={$v.qq}&amp;site=qq&amp;menu=yes">{$v.qq}</a>
                          </td>
                          <td>
                            {php echo date('Y-m-d H:i:s',$v['atime'])}
                          </td>
                          <td class="text-center">
                            {if $v['state']==1}
                            <span class="text-success">正常</span>
                            {else}
                            <span class="text-danger">暂停授权</span>
                            {/if}
                          </td>
                          <td style="width:60px;"> 
                            <button type="button" class="btn btn-dark" data-toggle="modal" data-target="#bianji" data-whatever="{'id':'{$v.id}','domain':'{$v.domain}','xiangmu':'{$v.xiangmu}','qq':'{$v.qq}','state':'{$v.state}'}">
                                <i class="fa fa-edit"></i>编辑
                            </button>
                            <button type="button" class="btn btn-danger"  data-toggle="modal" data-target="#shanchu" data-whatever="{$v.id}">
                                <i class="mdi mdi-alert-outline"></i>删除
                            </button>
                          </td>
                        </tr>
                        {/foreach}
                      </tbody>
                    </table>
                    <div class=" ">
                        <div class="text-center mt-4">
                            <a href="{if $pageid==1}javascript:void(0);{else}{php echo DN_URL('admin','shouquan_list');}?page={$pageid-1}{/if}"  class="btn btn-primary {if $pageid==1}disabled{/if}" ><i class="fa fa-arrow-left"></i> 上一页</a>
                            <a href="{if $pageid==$page_count}javascript:void(0);{else}{php echo DN_URL('admin','shouquan_list');}?page={$pageid+1}{/if}" class="btn btn-primary {if $pageid==$page_count}disabled{/if}" >下一页 <i class="fa fa-arrow-right"></i></a>
                        </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
            <!-- 编辑 -->
            <div class="modal fade" id="bianji" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel-bianji" aria-hidden="true">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="exampleModalLabel-bianji">编辑</h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body">
                        <form id="edit" class="forms-sample">
                            <div class="form-group">
                                <label for="exampleInputEmail1">域名</label>
                                <input type="text" name="domain" class="form-control" id="exampleInputEmail1" placeholder="">
                                <input type="hidden" name="id" class="form-control" id="exampleInputEmail1" placeholder="">
                            </div>
                            <div class="form-group">
                                <label for="exampleInputPassword1">项目</label>
                                <input type="text" name="xiangmu" class="form-control" id="exampleInputPassword1" placeholder="">
                            </div>
                            <div class="form-group">
                                <label for="exampleInputPassword1">QQ</label>
                                <input type="text" name="qq" class="form-control" id="exampleInputPassword1" placeholder="">
                            </div>
                            <div class="form-group zhuangtai">
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-success" onclick="edit()">修改</button>
                    </div>
                    </div>
                </div>
            </div>
            <!-- 删除 -->
            <div class="modal fade" id="shanchu" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel-bianji" aria-hidden="true">
                    <div class="modal-dialog" role="document">
                        <div class="modal-content">
                        <div class="modal-header">
                            <h5 class="modal-title" id="exampleModalLabel-bianji">警告</h5>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                            </button>
                        </div>
                        <div class="modal-body">
                            <div class="d-flex justify-content-center align-items-center text-danger">
                                <i class="fa fa-warning mr-3" style="font-size:3rem"></i> 确定删除吗？删除后不可恢复
                            </div>
                            <input type="hidden" name="id">
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                            <button type="button" class="btn btn-danger" onclick="del()">删除</button>
                        </div>
                        </div>
                    </div>
                </div>
        </div>
        <!-- content-wrapper ends -->
        <!-- partial:partials/_footer.html -->
        {include common/footer}
        <!-- partial -->
      </div>
      <!-- main-panel ends -->
    </div>
    <!-- page-body-wrapper ends -->
  </div>
  <!-- container-scroller -->
{include common/foot}